package com.youkeyi.ddy.cloud.common.constant;

/**
 * <p>
 *  常量扩展
 * </p>
 *
 * @author 23.1
 * @since 2020-05-11
 */
public class ConstantValue<T> {
    private T value;
    private String name;
    
    public ConstantValue(T value, String name) {
        this.value = value;
        this.name = name;
    }
    
    public ConstantValue(T value, String name, ConstantContainer<T> container) {
        this.value = value;
        this.name = name;
        if (null != container && null != value) {
            container.setValue(this);
        }
    }
    
    @Override
	public boolean equals(Object obj) {
		return value.equals(obj);
	}

	public final T value() {
        return value;
    }
    public final String name() {
        return name;
    }
}
